using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace The_LarX
{
    public class PhysicBody
    {
        public object Parent;

        public Rectangle Rectangle;

        public bool Immovable = false;
                
        public List<PhysicBody> Collisions;

        public Vector2 Velocity;
        public Vector2 Position;

        public PhysicBody(Rectangle Rect)
        {
            Collisions = new List<PhysicBody>();
            this.Rectangle = Rect;
        }

        public virtual void Update()
        {
            Position += Velocity;
            Velocity *= 0.5f;
        }

        public virtual void SerializeData(SerializeData Data)
        {
            Data.AddData("PhysicBody.Immovable", this.Immovable);
            Data.AddData("PhysicBody.Position", this.Position);
        }
        public virtual void DeserializeData(SerializeData Data)
        {
            this.Immovable = Data.GetData<bool>("PhysicBody.Immovable");
            this.Position = Data.GetData<Vector2>("PhysicBody.Position");
        }
    }
}
